package com.oig.sys.auth.dto;

import com.oig.common.validator.GroupAdd;
import com.oig.common.validator.GroupEdit;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;


@Schema(description = "岗位参数")
@Data
public class JobDto {

    @Schema(description = "主键id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "参数错误,id不能为空", groups= GroupEdit.class)
    private Integer id;

    @Schema(description = "岗位代码", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,岗位代码不能为空", groups={GroupAdd.class,GroupEdit.class})
    private String jobCode;

    @Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,岗位名称不能为空", groups={GroupAdd.class,GroupEdit.class})
    private String jobName;

    @Schema(description = "状态")
    private String status;

    @Schema(description = "所属租户id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "参数错误,所属租户id不能为空", groups={GroupAdd.class,GroupEdit.class})
    private Integer tenantId;
    @Schema(description = "租户编码")
    private String tenantCode;
    @Schema(description = "所属租户", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,所属租户不能为空", groups={GroupAdd.class,GroupEdit.class})
    private String tenantName;

    @Schema(description = "所属部门id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotNull(message = "参数错误,所属部门id不能为空", groups={GroupAdd.class,GroupEdit.class})
    private Integer departId;

    @Schema(description = "所属部门", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @NotEmpty(message = "参数错误,所属部门不能为空", groups={GroupAdd.class,GroupEdit.class})
    private String departName;


    @Schema(description = "岗位角色权限，配置岗位角色，只需传角色id")
    private List<RoleDto> roleList;
}
